function vnames = voi_VOINames(hfile)
% VOI::VOINames  - return a cell array (Nx1) of VOI names
%
% FORMAT:       vnames = voi.VOINames;
%
% No input fields.
%
% Output fields:
%
%       vnames      Nx1 list with VOI names

% Version:  v0.7f
% Build:    9022317
% Date:     Feb-23 2009, 5:56 PM CET
% Author:   Jochen Weber, SCAN Unit, Columbia University, NYC, NY, USA
% URL/Info: http://wiki.brainvoyager.com/BVQXtools

% argument check
if nargin < 1 || ...
    numel(hfile) ~= 1 || ...
   ~isBVQXfile(hfile, 'voi')
    error( ...
        'BVQXfile:BadArgument', ...
        'Invalid call to %s.', ...
        mfilename ...
    );
end
bc = bvqxfile_getcont(hfile.L);

% build cell array
vnames = cell(numel(bc.VOI), 1);

% fill array
for cc = 1:numel(vnames)
    vnames{cc} = bc.VOI(cc).Name;
end
